fix: [CO-440] properly de-register Account AuthToken in EndSession API #119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What has changed:
The deRegister method of ZimbraAuthToken class has been modified to parse the server_version as empty string if it is null (server_version is always null since we dont set server's server_version property in Carbonio for some reasons).
This string along with other components form a unique dynamic identifier which is used to remove values from account entries in this case for zimbraAuthTokens which is ephermal attribute in nature.
Now, in EndSessionReuqest if logOff attribute is set to true it will properly invalidate the cookie on SOAP servelet and properly delete the AuthToken for the account in directory-server.
Other changes
In addition the handle method of EndSession service was refactored and a portion of the method was extracted to new clearAllSessions method which allows clealall sessions if all="true" is passed in API call.
Tests:
Set of e2e tests were utilized to validate & confirm the above behavior.